<?php
/**
 * 检测验证码
 * @param  integer $id 验证码ID
 * @return boolean     检测结果
 * @author yishuguang <2915189136@qq.com>
 */
function check_verify($code, $id = 1){
    $verify = new \Think\Verify();
    return $verify->check($code, $id);
}

function format_price($price, $prefix = '', $suffix = '') {
    $format_price = '<span><b>￥' . $price . '</b></span> 元/人';
    if ($price > 10000) {
        $format_price = '<span><b>￥' . number_format($price / 10000, 2) . '</b></span> 万/人';
    }
    return $format_price;
}

function get_current_url() {
    return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}